using System;
using System.Drawing;
using EPiServer.Common;
using EPiServer.Common.Publishing;
using EPiServer.Common.Security;
using EPiServer.Community.ImageGallery;
using EPiServer.Community.ImageGallery.Queries;
using Image=EPiServer.Community.ImageGallery.Image;

namespace EPiAbstractions.Community.ImageGallery
{
    public interface IImageGalleryHandlerFacade
    {
        EPiServer.Community.ImageGallery.ImageGallery AddImageGallery(EPiServer.Community.ImageGallery.ImageGallery gallery);

        void UpdateImageGallery(EPiServer.Community.ImageGallery.ImageGallery gallery);

        void RemoveImageGallery(EPiServer.Community.ImageGallery.ImageGallery gallery);

        EPiServer.Community.ImageGallery.ImageGallery GetImageGallery(Int32 id);

        ImageGalleryCollection GetImageGalleryChildren(EPiServer.Community.ImageGallery.ImageGallery imageGallery);

        ImageGalleryCollection GetImageGalleries(Int32 page, Int32 pageSize, ImageGallerySortOrder[] sortOrder);

        ImageGalleryCollection GetImageGalleries(Int32 page, Int32 pageSize, out Int32 totalItems, ImageGallerySortOrder[] sortOrder);

        ImageGalleryCollection GetImageGalleries(SiteCollection sites, Int32 page, Int32 pageSize, ImageGallerySortOrder[] sortOrder);

        ImageGalleryCollection GetImageGalleries(SiteCollection sites, Int32 page, Int32 pageSize, out Int32 totalItems,
                                                 ImageGallerySortOrder[] sortOrder);

        Int32 GetNumOfImages(PublishState state);

        Int32 GetNumOfImages(PublishState state, Boolean ignoreCache);

        Int32 GetNumOfImages(PublishState state, SiteCollection sites, Boolean ignoreCache);

        Int32 GetNumOfImages(IUser uploader);

        void ChangeUploader(EPiServer.Community.ImageGallery.ImageGallery gallery, IUser oldUploader, IUser newUploader);

        Image AddImage(Image image, Boolean ignoreQuota);

        void UpdateImage(Image image);

        void RemoveImage(Image image);

        void ImportEditedImage(Image image, String source, ImageAction[] actions);

        Image AddImage(Image image);

        Image GetImage(Int32 id);

        ImageCollection GetImages(Int32 page, Int32 pageSize, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(Int32 page, Int32 pageSize, out Int32 totalItems, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(Int32 page, Int32 pageSize, PublishState publishState, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(Int32 page, Int32 pageSize, PublishState publishState, out Int32 totalItems, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(Int32 page, Int32 pageSize, PublishState publishState, Boolean ignoreCache, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(Int32 page, Int32 pageSize, PublishState publishState, Boolean ignoreCache, out Int32 totalItems,
                                  ImageSortOrder[] sortOrder);

        ImageCollection GetImages(ImageGalleryCollection galleries, Int32 page, Int32 pageSize, PublishState publishState,
                                  ImageSortOrder[] sortOrder);

        ImageCollection GetImages(ImageGalleryCollection galleries, Int32 page, Int32 pageSize, PublishState publishState,
                                  out Int32 totalItems, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(ImageGalleryCollection galleries, Int32 page, Int32 pageSize, PublishState publishState,
                                  Boolean ignoreCache, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(ImageGalleryCollection galleries, Int32 page, Int32 pageSize, PublishState publishState,
                                  Boolean ignoreCache, out Int32 totalItems, ImageSortOrder[] sortOrder);

        ImageCollection GetImages(ImageGalleryCollection galleries, Int32 page, Int32 pageSize, PublishState publishState,
                                  Boolean ignoreCache, TimeSpan? explicitCacheTime, out Int32 totalItems, ImageSortOrder[] sortOrder);

        ImageComment AddImageComment(ImageComment comment);

        void UpdateImageComment(ImageComment comment);

        void RemoveImageComment(ImageComment comment);

        ImageComment GetImageComment(Int32 id);

        ImageCommentCollection GetImageComments(Image image, Int32 page, Int32 pageSize, ImageCommentSortOrder[] sortOrder);

        ImageCommentCollection GetImageComments(Image image, Int32 page, Int32 pageSize, out Int32 totalItems,
                                                ImageCommentSortOrder[] sortOrder);

        void RemoveThumbnails(Image image);

        Thumbnail GetThumbnail(Image image, Int32 width, Int32 height, ThumbnailFormat thumbnailFormat);

        Thumbnail GetThumbnail(Image image, Int32 width, Int32 height, ThumbnailFormat thumbnailFormat, Boolean createThumbnail);

        Thumbnail GetThumbnail(Image image, Int32 width, Int32 height, ThumbnailFormat thumbnailFormat, Boolean createThumbnail,
                               Boolean tagThumbnail);

        Thumbnail GetThumbnail(Image image, Int32 width, Int32 height, ThumbnailFormat thumbnailFormat, Boolean createThumbnail,
                               Watermark thumbnailTag);

        Thumbnail GetThumbnail(Image image, Int32 width, Int32 height, ThumbnailFormat thumbnailFormat, Boolean createThumbnail,
                               Watermark thumbnailTag, Color thumbBgColor);

        event EPiServerCommonEventHandler ImageAdded;

        event EPiServerCommonEventHandler ImageUpdated;

        event EPiServerCommonEventHandler ImageRemoved;

        event EPiServerCommonEventHandler ImageVote;

        event EPiServerCommonEventHandler ImageGalleryAdded;

        event EPiServerCommonEventHandler ImageGalleryUpdated;

        event EPiServerCommonEventHandler ImageGalleryRemoved;

        event EPiServerCommonEventHandler ImageCommentAdded;

        event EPiServerCommonEventHandler ImageCommentUpdated;

        event EPiServerCommonEventHandler ImageCommentRemoved;

        ImageCollection GetQueryResult(ImageQuery query);

        ImageCollection GetQueryResult(ImageQuery query, Int32 page, Int32 pageSize);

        ImageCollection GetQueryResult(ImageQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        ImageGalleryCollection GetQueryResult(ImageGalleryQuery query);

        ImageGalleryCollection GetQueryResult(ImageGalleryQuery query, Int32 page, Int32 pageSize);

        ImageGalleryCollection GetQueryResult(ImageGalleryQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        ImageCommentCollection GetQueryResult(ImageCommentQuery query);

        ImageCommentCollection GetQueryResult(ImageCommentQuery query, Int32 page, Int32 pageSize);

        ImageCommentCollection GetQueryResult(ImageCommentQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}